<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
		<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
		<html>
		<head>
			<title>内容发布管理</title>
			<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
			<jsp:include page="/WEB-INF/views/include/newhead.jsp" />
		</head>
		<body class="childrenBody site-block">
			<header class="larry-personal-tit">
				<span>
				    <!-- contentPublish 将user对应替换 -->
					<c:if test="${empty contentPublish.id}">新增</c:if>
					<c:if test="${not empty contentPublish.id}">修改</c:if>
				</span>
			</header>
			
			<div class="mainCon">
				<form:form id="inputForm" autocomplete="off" modelAttribute="contentPublish" action="${ctx}/content/contentPublish/save" method="post">
					<form:hidden path="id"/>
					<sys:message content="${message}"/>
					
							<div class="layui-form-item">
							   <div class="layui-inline">
									<label class="layui-form-label"><font color="red">*</font>描述</label>
									<div class="layui-input-inline layui-input-inline-one">
										<form:textarea path="titleDescribe" placeholder="请输入描述" rows="3" maxlength="2000" class="layui-textarea"/>
									</div>
							   </div>
							</div>
							<div class="layui-form-item">
							   <div class="layui-inline">
									<label class="layui-form-label"><font color="red">*</font>视频</label>
									<div class="layui-input-inline">
									   <button type="button" class="layui-btn layui-btn-primary layui-btn-sm">选择文件</button>
									</div>
							   </div>
							</div>
							<div class="layui-form-item">
		                       <div class="layui-inline">
								    <label class="layui-form-label">发布账号</label>
								    <div class="layui-input-inline">
								     <div class="radio icheck-nephritis checkbox-extend">
										<input onclick="doAllonchange();" type="radio" id="boy" checked="checked" name="doAll" value="1" />
										<label for="boy">全部账号</label>
			                          </div>
			                          <div class="radio icheck-nephritis checkbox-extend">
										<input onclick="doAllonchange();" type="radio" id="girl" name="doAll" value="2" />
										<label for="girl">部分账号</label>
			                         </div>
								    </div>
							    </div>
                           </div>
							<div id="accounts_div" class="layui-form-item" style="display: none">
							   <div class="layui-inline">
									<label class="layui-form-label">选择账号</label>
									<div class="layui-input-inline layui-input-inline-one">
								      <sys:dialogTableSelect id="role" name="roleIds" value="${contentPublish.accounts}"
										cssClass="layui-input layui-input-treeselect required" labelName="" labelValue="${contentPublish.accounts}" title="选择账号"
										width="1000" tableSelectId="id" tableSelectName="name" height="600" allowClear="true"
										includeUrl="/WEB-INF/views/modules/sys/roleListBydialog.jsp?roleType=1"
										singleSelect="false" params=""  draggable="true"/>
								   </div>
							   </div>
							</div>
							<div class="layui-form-item">
							   <div class="layui-inline">
									<label class="layui-form-label">发布转态</label>
									 <div class="layui-input-inline layui-input-inline-one">
								     <div class="radio icheck-nephritis checkbox-extend">
										<input onclick="publishTypeonchange();" type="radio" id="publishType1" checked="checked" name="publishType" value="1" />
										<label for="publishType1">立即发布</label>
			                          </div>
			                          <div class="radio icheck-nephritis checkbox-extend">
										<input onclick="publishTypeonchange();" type="radio" id="publishType2" name="publishType" value="2" />
										<label for="publishType2">定时发布</label>
			                         </div>
			                         									 <!-- 时间没有设计 -->
			                         <input id="publishDate" name="publishType" type="text" readonly="readonly" maxlength="20" class="layui-input dateInput" style="width: 160px;display: none;pad"
												value="<fmt:formatDate value="${contentPublish.publishType}" pattern="yyyy-MM-dd HH:mm:ss"/>"
												onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"  placeholder="请输入发布时间"/>
								    </div>
							   </div>
							</div>
							
							<div class="layui-form-item">
							   <div class="layui-inline">
									<label class="layui-form-label"><font color="red">*</font>发布平台</label>
									<div class="layui-input-inline layui-input-inline-one">
										     <div class="checkbox icheck-nephritis checkbox-extend">
												<input onclick="hadChecked('dy');" checked="checked" type="checkbox" name="doPlatform" value="1" id="dy" />
												<label for="dy">抖音</label>
					                          </div>
					                          <div class="checkbox icheck-nephritis checkbox-extend">
												<input onclick="hadChecked('ks');" checked="checked"  type="checkbox" name="doPlatform" value="2" id="ks" />
												<label for="ks">快手</label>
					                         </div>
					                         <div class="checkbox icheck-nephritis checkbox-extend">
												<input onclick="hadChecked('xhs');" checked="checked"  type="checkbox" id="xhs" name="doPlatform" value="3" />
												<label for="xhs">小红书</label>
					                         </div>
									</div>
							   </div>
							</div>
							
							<div id="dy_info_div">
								<fieldset class="layui-elem-field layui-field-title" style="margin-top: 5px;">
								  <legend>抖音特性内容</legend>
								</fieldset>
								
							<div class="layui-form-item">
							    <div class="layui-inline">
							      <label class="layui-form-label">允许他人保存视频</label>
									<div class="layui-input-inline">
								     <div class="radio icheck-nephritis checkbox-extend">
										<input  type="radio" id="canSave1" checked="checked" name="canSave" value="1" />
										<label for="canSave1">允许</label>
			                          </div>
			                          <div class="radio icheck-nephritis checkbox-extend">
										<input  type="radio" id="canSave0" name="canSave" value="0" />
										<label for="canSave0">不允许</label>
			                         </div>
								    </div>
							    </div>
							    
							    <div class="layui-inline">
										<div class="layui-inline">
										<label class="layui-form-label"><font color="red">*</font>视频分类</label>
										<div class="layui-input-inline">
											<form:select path="dyVideoType" cssClass="select2_ " >
												<form:option value="" label="请选择"/>
											</form:select>    
										</div>
									    </div>
								 </div>
							</div>
							
							<div class="layui-form-item">
							   <div class="layui-inline">
									<label class="layui-form-label">查看权限</label>
									<div class="layui-input-inline layui-input-inline-one">
								     <div class="radio icheck-nephritis checkbox-extend">
										<input  type="radio" id="dySee1" checked="checked" name="dySee" value="1" />
										<label for="dySee1">公开</label>
			                          </div>
			                          <div class="radio icheck-nephritis checkbox-extend">
										<input  type="radio" id="dySee2" name="dySee" value="2" />
										<label for="dySee2">好友可见</label>
			                         </div>
			                          <div class="radio icheck-nephritis checkbox-extend">
										<input  type="radio" id="dySee3" name="dySee" value="3" />
										<label for="dySee3">仅自己可见</label>
			                         </div>
								    </div>
							   </div>
							</div>
							
						</div>
							
							
						 <div id="ks_info_div">
								<fieldset class="layui-elem-field layui-field-title" style="margin-top: 5px;">
								  <legend>快手特性内容</legend>
								</fieldset>
							
							<div class="layui-form-item">
							   <div class="layui-inline">
									<label class="layui-form-label">封面</label>
									<div class="layui-input-inline">
										<button type="button" class="layui-btn layui-btn-primary layui-btn-sm">选择文件</button>
									</div>
							   </div>
							</div>
						</div>
							
							<div class="layui-form-item">
							   <div class="layui-inline">
									<label class="layui-form-label">查看权限</label>
									<div class="layui-input-inline layui-input-inline-one">
								     <div class="radio icheck-nephritis checkbox-extend">
										<input  type="radio" id="ksSee1" checked="checked" name="ksSee" value="1" />
										<label for="ksSee1">公开</label>
			                          </div>
			                          <div class="radio icheck-nephritis checkbox-extend">
										<input  type="radio" id="ksSee2" name="ksSee" value="2" />
										<label for="ksSee2">仅自己可见</label>
			                         </div>
								    </div>
							   </div>
							</div>
							
						 <div id="xhs_info_div">
								<fieldset class="layui-elem-field layui-field-title" style="margin-top: 5px;">
								  <legend>小红书特性内容</legend>
								</fieldset>
								
								<div class="layui-form-item">
								   <div class="layui-inline">
										<label class="layui-form-label">小红书正文</label>
										<div class="layui-input-inline layui-input-inline-one">
											<form:textarea path="textPart" placeholder="请输入小红书正文"  maxlength="200" class="layui-textarea"/>
										</div>
								   </div>
								</div>
						 </div>

							
					<div class="layui-form-item bottom_xf">
						<div class="layui-input-block input500">
							<button type="button" class="layui-btn layui-btn-primary" onclick="gotoView('${ctx}/content/contentPublish/');">返回</button>
							<button class="layui-btn" type="submit">发布</button>
							<button onclick="formReset();" type="button"  class="layui-btn layui-btn-danger">重置</button>
						</div>
					</div>
				</form:form>
			</div>

            <jsp:include page="/WEB-INF/views/include/pageJs.jsp" />
			
			<script type="text/javascript">
				$(document).ready(function() {
					$("#inputForm").validate({
						submitHandler: function(form){
							//loading('正在提交，请稍等...');
							//form.submit();
							return;
						},
						errorContainer: "#messageBox",
						errorPlacement: function(error, element) {
							$("#messageBox").text("输入有误，请先更正。");
							if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
								error.appendTo(element.parent().parent());
							} else {
								error.insertAfter(element);
							}
						}
					});
				});
				
				function doAllonchange(){
					var doAll = $('input[name="doAll"]:checked').val(); 
					if(doAll == "2"){
						$("#accounts_div").show();
					}else{
						$("#accounts_div").hide();
					}
				}
				
				function publishTypeonchange(){
					var doAll = $('input[name="publishType"]:checked').val(); 
					if(doAll == "2"){
						$("#publishDate").show();
					}else{
						$("#publishDate").hide();
					}
				}
				
				function hadChecked(doPlatform){
					if(doPlatform == "ks"){
						if($('#ks').is(':checked')) {
							$("#ks_info_div").show();
						}else{
							$("#ks_info_div").hide();
						}
					}else if(doPlatform == "dy"){
						if($('#dy').is(':checked')) {
							$("#dy_info_div").show();
						}else{
							$("#dy_info_div").hide();
						}
					}else if(doPlatform == "xhs"){
						if($('#xhs').is(':checked')) {
							$("#xhs_info_div").show();
						}else{
							$("#xhs_info_div").hide();
						}
					}
				}
			</script>
		</body>
		</html>